<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import = "java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file = "lianjie.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		String userID = request.getParameter("userID");	
		String ISBN = request.getParameter("ISBN");	
		String back_book = "delete from borrowinformation  where userID = '" + userID + "' and bookISBN = '" + ISBN + "'";
		stmt.executeUpdate(back_book);
		String sql = "update booksmassage set surplus=surplus+1 where ISBN='" + ISBN + "'";
		String sql2 = "update booksmassage set loan=loan-1 where ISBN='" + ISBN + "'";
		stmt.executeUpdate(sql);
		stmt.executeUpdate(sql2);
		out.print("还书成功");
		response.setHeader("Refresh","2;URL = teacher.jsp");
		
	%>
</body>
</html>